package com.xxkj.drugtraceability.ui.main

import com.xxkj.drugtraceability.base.BaseRepository
import com.xxkj.drugtraceability.bean.BaseData
import com.xxkj.drugtraceability.bean.ConfigBean
import com.xxkj.drugtraceability.bean.RouterData
import com.xxkj.drugtraceability.net.Result
import com.xxkj.drugtraceability.net.WanService

/**
 * author: zhoujingjin
 * created on: 2024/9/10 9:04
 * description:
 */
class MainRepository(private val wanService: WanService):BaseRepository() {

    suspend fun getRouters(): Result<RouterData> {
        return safeApiCall { executeResponse(wanService.getRouters()) }
    }
    suspend fun configKey(key:String): Result<BaseData<ConfigBean>> {
        return safeApiCall { executeResponse(wanService.configKey(key)) }
    }
}